File information: | |
File name: | StreamIO.mesa_Oct77.pdf [preview StreamIO.mesa Oct77] |
Size: | 209 kB |
Extension: | |
Mfg: | xerox |
Model: | StreamIO.mesa Oct77 🔎 |
Original: | StreamIO.mesa Oct77 🔎 |
Descr: | xerox mesa 3.0_1977 listing StreamIO.mesa_Oct77.pdf |
Group: | Electronics > Other |
Uploaded: | 08-02-2020 |
User: | Anonymous |
Multipart: | No multipart |
Information about the files in archive: | ||
Decompress result: | OK | |
Extracted files: | 1 | |
File name StreamIO.mesa_Oct77.pdf streamio.mESA 24-0CT-77 18:57:26 Pag9 1 -- StreamlO.Mesa Edited by Sandman on July 22, 1977 11:07 AM DIRECTORY IODefs: FROM "iodefs", InlineDefs: FROM "in11nedefs". StreamDefs: FROM "streamdefs", Str1ngDefs: FROM "stringdefs": DEFINITIONS FROM StreamDefs, IODefs: StreamlO: PROGRAM [Input. Output: StreamHandle] IMPORTS StreamDefs. StringDefs EXPORTS lODefs SHARES IODefs. StreamDefs PUBLIC BEGIN BeginLine: PRIVATE BOOLEAN ~ TRUE: GetInputStream: PROCEDURE RETURNS [StreamHandle] a BEGIN RETURN[Input] END: GetOutputStream: PROCEDURE RETURNS [StreamHandle] = BEGIN RETURN[Output] END: -- Character operations ReadChar: PROCEDURE RETURNS [CHARACTER] = BEGIN RETURN[Input.get[Input]]: END: WriteChar: PROCEDURE [c:CHARACTER] = BEGIN Output.put[Output. c]: BeginLine ~ c = CR: END: -- Reading Strings ReadString: PROCEDURE [s:STRING. t:PROCEDURE[CHARACTER]RETURNS(BOOLEAN]] BEGIN WriteChar[ReadEditedString[s.t.TRUE]]: END: ReadID: PROCEDURE [s:STRING] = BEGIN [] ~ ReadEditedString[s.atomfound.TRUE]: END; ReadLine: PROCEDURE [s:STRING] = BEGIN [] ~ ReadEditedString[s.crfound.TRUE]; WriteChar[CR]; END; crfound: PRIVATE PROCEDURE [c:CHARACTER] RETURNS [BOOLEAN] = B[GIN RETURN [c = CR] END: atomfound: PRIVATE PROCEDURF [c:CHARACTER] RETURNS [BOOLEAN] B[GIN RrTURN [c = CR OR c = SP] END: Rubout: SIGNAL = CODF: LineOverflow: SIGNAL [5: STRING] RETURNS ens: STRING] CODE: -- the editing characters controlA: CIlARACTrR 1C; delete character controlll: CIlARAcrrR laC: delete character conlrolW: CIIARACTER 27C: delete word controlQ: CIIARACHR 21C: delete word controlX: CIIARACHR JOC: delete 1 ine streamio.mESA 24-0CT-77 18:57:26 Page 2 controlR: CHARACTER = 22C; retype line controlV: CHARACTER = 26C; quote next character ESC: CHARACTER = 33C; use old string ReadEditedString: PROCEDURE [s:STRING, t:PROCEDURE [CHARACTER] RETURNS [BOOLEAN], newstring:BOOLEAN] RE **TURNS[CHARACTER] = BEGIN c: CHARACTER; i: CARDINAL; state: {TrailingInvisible, Visible, LeadingInvisible}; c ~ Input.get[Input]: IF newstring THEN IF c = ESC THEN BEGIN WriteString[s]; c ~ Input.get[Input]; END ELSE s. length ~ 0; UNTIL t[c] DO SELECT c FROM DEL => SIGNAL Rubout; controlA, controlH =) BEGIN IF s. length> 0 THEN BEGIN WITH Output SELECT FROM Display => ClearDisplayChar[Output,s[s.length-1]]; ENDCASE => Output.put[OutPut.c]; s. length ~ s. length-1; END; END: controlW, controlQ .> BEGIN -- text to be backed up is of the form -- ... |
Date | User | Rating | Comment |